<#assign prefixName = true>
<#if (where_and_eq_address??)>
<#if (where_and_eq_address_value??)>
${prefixName?string('WHERE ', 'AND ')}address = :where_and_eq_address_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(address IS NULL OR address = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_areaCode??)>
<#if (where_and_eq_areaCode_value??)>
${prefixName?string('WHERE ', 'AND ')}area_code = :where_and_eq_areaCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(area_code IS NULL OR area_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_batchNo??)>
<#if (where_and_eq_batchNo_value??)>
${prefixName?string('WHERE ', 'AND ')}batch_no = :where_and_eq_batchNo_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(batch_no IS NULL OR batch_no = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_beginDate??)>
<#if (where_and_eq_beginDate_value??)>
${prefixName?string('WHERE ', 'AND ')}begin_date = :where_and_eq_beginDate_value
<#else>
${prefixName?string('WHERE ', 'AND ')}begin_date IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_cityCode??)>
<#if (where_and_eq_cityCode_value??)>
${prefixName?string('WHERE ', 'AND ')}city_code = :where_and_eq_cityCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(city_code IS NULL OR city_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_compatibleDepartmentCode1??)>
<#if (where_and_eq_compatibleDepartmentCode1_value??)>
${prefixName?string('WHERE ', 'AND ')}compatible_department_code_1 = :where_and_eq_compatibleDepartmentCode1_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(compatible_department_code_1 IS NULL OR compatible_department_code_1 = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_compatibleDepartmentCode2??)>
<#if (where_and_eq_compatibleDepartmentCode2_value??)>
${prefixName?string('WHERE ', 'AND ')}compatible_department_code_2 = :where_and_eq_compatibleDepartmentCode2_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(compatible_department_code_2 IS NULL OR compatible_department_code_2 = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_compatibleParentCode1??)>
<#if (where_and_eq_compatibleParentCode1_value??)>
${prefixName?string('WHERE ', 'AND ')}compatible_parent_code_1 = :where_and_eq_compatibleParentCode1_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(compatible_parent_code_1 IS NULL OR compatible_parent_code_1 = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_compatibleParentCode2??)>
<#if (where_and_eq_compatibleParentCode2_value??)>
${prefixName?string('WHERE ', 'AND ')}compatible_parent_code_2 = :where_and_eq_compatibleParentCode2_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(compatible_parent_code_2 IS NULL OR compatible_parent_code_2 = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_createdByCode??)>
<#if (where_and_eq_createdByCode_value??)>
${prefixName?string('WHERE ', 'AND ')}created_by_code = :where_and_eq_createdByCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(created_by_code IS NULL OR created_by_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_createdById??)>
<#if (where_and_eq_createdById_value??)>
${prefixName?string('WHERE ', 'AND ')}created_by_id = :where_and_eq_createdById_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(created_by_id IS NULL OR created_by_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_createdDate??)>
<#if (where_and_eq_createdDate_value??)>
${prefixName?string('WHERE ', 'AND ')}created_date = :where_and_eq_createdDate_value
<#else>
${prefixName?string('WHERE ', 'AND ')}created_date IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_dataStateCode??)>
<#if (where_and_eq_dataStateCode_value??)>
${prefixName?string('WHERE ', 'AND ')}data_state_code = :where_and_eq_dataStateCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(data_state_code IS NULL OR data_state_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_departmentCode??)>
<#if (where_and_eq_departmentCode_value??)>
${prefixName?string('WHERE ', 'AND ')}department_code = :where_and_eq_departmentCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(department_code IS NULL OR department_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_departmentId??)>
<#if (where_and_eq_departmentId_value??)>
${prefixName?string('WHERE ', 'AND ')}department_id = :where_and_eq_departmentId_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(department_id IS NULL OR department_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_endDate??)>
<#if (where_and_eq_endDate_value??)>
${prefixName?string('WHERE ', 'AND ')}end_date = :where_and_eq_endDate_value
<#else>
${prefixName?string('WHERE ', 'AND ')}end_date IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_flagCode??)>
<#if (where_and_eq_flagCode_value??)>
${prefixName?string('WHERE ', 'AND ')}flag_code = :where_and_eq_flagCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(flag_code IS NULL OR flag_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_flagObjectCode??)>
<#if (where_and_eq_flagObjectCode_value??)>
${prefixName?string('WHERE ', 'AND ')}flag_object_code = :where_and_eq_flagObjectCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(flag_object_code IS NULL OR flag_object_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_jsonData??)>
<#if (where_and_eq_jsonData_value??)>
${prefixName?string('WHERE ', 'AND ')}json_data = :where_and_eq_jsonData_value
<#else>
${prefixName?string('WHERE ', 'AND ')}json_data IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_lastModifiedByCode??)>
<#if (where_and_eq_lastModifiedByCode_value??)>
${prefixName?string('WHERE ', 'AND ')}last_modified_by_code = :where_and_eq_lastModifiedByCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(last_modified_by_code IS NULL OR last_modified_by_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_lastModifiedById??)>
<#if (where_and_eq_lastModifiedById_value??)>
${prefixName?string('WHERE ', 'AND ')}last_modified_by_id = :where_and_eq_lastModifiedById_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(last_modified_by_id IS NULL OR last_modified_by_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_lastModifiedDate??)>
<#if (where_and_eq_lastModifiedDate_value??)>
${prefixName?string('WHERE ', 'AND ')}last_modified_date = :where_and_eq_lastModifiedDate_value
<#else>
${prefixName?string('WHERE ', 'AND ')}last_modified_date IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_lastSyncTime??)>
<#if (where_and_eq_lastSyncTime_value??)>
${prefixName?string('WHERE ', 'AND ')}last_sync_time = :where_and_eq_lastSyncTime_value
<#else>
${prefixName?string('WHERE ', 'AND ')}last_sync_time IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_name??)>
<#if (where_and_eq_name_value??)>
${prefixName?string('WHERE ', 'AND ')}name = :where_and_eq_name_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(name IS NULL OR name = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_orderBy??)>
<#if (where_and_eq_orderBy_value??)>
${prefixName?string('WHERE ', 'AND ')}order_by_ = :where_and_eq_orderBy_value
<#else>
${prefixName?string('WHERE ', 'AND ')}order_by_ IS NULL
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_orgCode??)>
<#if (where_and_eq_orgCode_value??)>
${prefixName?string('WHERE ', 'AND ')}org_code = :where_and_eq_orgCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(org_code IS NULL OR org_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_orgId??)>
<#if (where_and_eq_orgId_value??)>
${prefixName?string('WHERE ', 'AND ')}org_id = :where_and_eq_orgId_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(org_id IS NULL OR org_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_parentCode??)>
<#if (where_and_eq_parentCode_value??)>
${prefixName?string('WHERE ', 'AND ')}parent_code = :where_and_eq_parentCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(parent_code IS NULL OR parent_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_parentId??)>
<#if (where_and_eq_parentId_value??)>
${prefixName?string('WHERE ', 'AND ')}parent_id = :where_and_eq_parentId_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(parent_id IS NULL OR parent_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_parentTreeCode??)>
<#if (where_and_eq_parentTreeCode_value??)>
${prefixName?string('WHERE ', 'AND ')}parent_tree_code = :where_and_eq_parentTreeCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(parent_tree_code IS NULL OR parent_tree_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_parentTreeId??)>
<#if (where_and_eq_parentTreeId_value??)>
${prefixName?string('WHERE ', 'AND ')}parent_tree_id = :where_and_eq_parentTreeId_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(parent_tree_id IS NULL OR parent_tree_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_parentTreeName??)>
<#if (where_and_eq_parentTreeName_value??)>
${prefixName?string('WHERE ', 'AND ')}parent_tree_name = :where_and_eq_parentTreeName_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(parent_tree_name IS NULL OR parent_tree_name = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_personalCode??)>
<#if (where_and_eq_personalCode_value??)>
${prefixName?string('WHERE ', 'AND ')}personal_code = :where_and_eq_personalCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(personal_code IS NULL OR personal_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_personalId??)>
<#if (where_and_eq_personalId_value??)>
${prefixName?string('WHERE ', 'AND ')}personal_id = :where_and_eq_personalId_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(personal_id IS NULL OR personal_id = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_provinceCode??)>
<#if (where_and_eq_provinceCode_value??)>
${prefixName?string('WHERE ', 'AND ')}province_code = :where_and_eq_provinceCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(province_code IS NULL OR province_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_regionCode??)>
<#if (where_and_eq_regionCode_value??)>
${prefixName?string('WHERE ', 'AND ')}region_code = :where_and_eq_regionCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(region_code IS NULL OR region_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_siteCode??)>
<#if (where_and_eq_siteCode_value??)>
${prefixName?string('WHERE ', 'AND ')}site_code = :where_and_eq_siteCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(site_code IS NULL OR site_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_sourceCode??)>
<#if (where_and_eq_sourceCode_value??)>
${prefixName?string('WHERE ', 'AND ')}source_code = :where_and_eq_sourceCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(source_code IS NULL OR source_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_stateCode??)>
<#if (where_and_eq_stateCode_value??)>
${prefixName?string('WHERE ', 'AND ')}state_code = :where_and_eq_stateCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(state_code IS NULL OR state_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_syncReturnCode??)>
<#if (where_and_eq_syncReturnCode_value??)>
${prefixName?string('WHERE ', 'AND ')}sync_return_code = :where_and_eq_syncReturnCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(sync_return_code IS NULL OR sync_return_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_syncReturnMessage??)>
<#if (where_and_eq_syncReturnMessage_value??)>
${prefixName?string('WHERE ', 'AND ')}sync_return_message = :where_and_eq_syncReturnMessage_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(sync_return_message IS NULL OR sync_return_message = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_systemInfoCode??)>
<#if (where_and_eq_systemInfoCode_value??)>
${prefixName?string('WHERE ', 'AND ')}system_info_code = :where_and_eq_systemInfoCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(system_info_code IS NULL OR system_info_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_thirdPartyCode??)>
<#if (where_and_eq_thirdPartyCode_value??)>
${prefixName?string('WHERE ', 'AND ')}third_party_code = :where_and_eq_thirdPartyCode_value
<#else>
${prefixName?string('WHERE ', 'AND ')}(third_party_code IS NULL OR third_party_code = '')
</#if>
<#assign prefixName = false>
</#if>
<#if (where_and_eq_version??)>
<#if (where_and_eq_version_value??)>
${prefixName?string('WHERE ', 'AND ')}version_ = :where_and_eq_version_value
<#else>
${prefixName?string('WHERE ', 'AND ')}version_ IS NULL
</#if>
<#assign prefixName = false>
</#if>
